package rabbit.topic;

import com.rabbitmq.client.Channel;
import com.rabbitmq.client.Connection;
import com.rabbitmq.client.ConnectionFactory;

/**
 * @Author: admin
 * @Description:
 * @Date: 2018/7/31 14:56
 */


public class UserProducer {
    private static final String EXCHANGE_NAME = "e.topic.hiddencall";//;"organizationExchange";// "outerhostexchange";
    private static final String TOPIC = "122";//"organizationTopic";// "outerhostexchange";

    public static void main(String[] argv) throws Exception {
        ConnectionFactory factory = new ConnectionFactory();
//        factory.setHost("39.106.17.245");
        factory.setHost("39.105.210.64");
        //factory.setHost("192.168.0.201");//"03156721261"







        factory.setVirtualHost("OuterHost");
        factory.setUsername("root");
        factory.setPassword("root");
        Connection connection = factory.newConnection();
        Channel channel = connection.createChannel();
        String jsonStr = "{\"data\":{\"userId\":1253,\"oldErpId\":0,\"userName\":\"Java部蔡鹏飞\",\"userGender\":\"男\",\"userIdNumber\":\"130206199706150916\",\"userTel\":\"13292325013\",\"virtualTel\":\"\",\"userDept\":43,\"userRoleId\":12,\"joinTime\":1545148800000,\"userState\":\"正常\",\"userDeleted\":0,\"userTwins\":0,\"userDeleteDate\":0,\"joinPosTime\":0,\"posLevel\":\"L1\"},\"utype\":\"user\"}";
        jsonStr="{\"data\":{\"userId\":2793,\"oldErpId\":0,\"userName\":\"质控部于娜\",\"userGender\":\"女\",\"userIdNumber\":\"130229199212150048\",\"userTel\":\"15732070700\",\"virtualTel\":\"03156273210\",\"userDept\":43,\"userRoleId\":23,\"joinTime\":1543420800000,\"userState\":\"正常\",\"userDeleted\":0,\"userTwins\":0,\"userDeleteDate\":0,\"joinPosTime\":1567267200,\"posLevel\":\"L2\",\"mobileWorkPhone\":\"15732070700\",\"mobileVirtual\":\"17897508387\"},\"utype\":\"user\"}";
        jsonStr="{\"data\":{\"userId\":2453,\"oldErpId\":66995,\"userName\":\"质控部张金桐\",\"userGender\":\"男\",\"userIdNumber\":\"130281199806212934\",\"userTel\":\"15097532730\",\"virtualTel\":\"03156273213(18633159152)\",\"userDept\":43,\"userRoleId\":4,\"joinTime\":1546876800000,\"userState\":\"正常\",\"userDeleted\":0,\"userTwins\":0,\"userDeleteDate\":0,\"joinPosTime\":1564416000,\"posLevel\":\"A6\",\"mobileWorkPhone\":\"15097532730\",\"mobileVirtual\":\"17897508393\"},\"utype\":\"user\"}";
        jsonStr="{\"data\":{\"userId\":5504,\"oldErpId\":0,\"userName\":\"质控部李明慧\",\"userGender\":\"男\",\"userIdNumber\":\"130822199706226012\",\"userTel\":\"18332658537\",\"virtualTel\":\"\",\"userDept\":43,\"userRoleId\":6,\"joinTime\":1564502400000,\"userState\":\"正常\",\"userDeleted\":0,\"userTwins\":0,\"userDeleteDate\":0,\"joinPosTime\":0,\"posLevel\":\"A3\",\"mobileWorkPhone\":\"18332658537\",\"mobileVirtual\":\"17897513283\"},\"utype\":\"user\"}";
        jsonStr="{\"data\":{\"userId\":5504,\"oldErpId\":0,\"userName\":\"测试部李明慧\",\"userGender\":\"男\",\"userIdNumber\":\"130822199706226012\",\"userTel\":\"18332658537\",\"virtualTel\":\"\",\"userDept\":43,\"userRoleId\":12,\"joinTime\":1564416000000,\"userState\":\"正常\",\"userDeleted\":0,\"userTwins\":0,\"userDeleteDate\":0,\"joinPosTime\":0,\"posLevel\":\"L1\",\"mobileWorkPhone\":\"18332658537\",\"mobileVirtual\":\"17897513283\"},\"utype\":\"user\"}";
        jsonStr="{\"data\":{\"userId\":1616,\"oldErpId\":63802,\"userName\":\"郑宝蕊\",\"userGender\":\"男\",\"userIdNumber\":\"130282199507025115\",\"userTel\":\"13011525005\",\"virtualTel\":\"03156273216(13031572657)\",\"userDept\":922,\"userRoleId\":4,\"joinTime\":1526745600000,\"userState\":\"正常\",\"userDeleted\":0,\"userTwins\":0,\"userDeleteDate\":0,\"joinPosTime\":0,\"posLevel\":\"A7\",\"mobileWorkPhone\":\"18716073916\",\"mobileVirtual\":\"17897518976\"},\"utype\":\"user\"}";
        jsonStr="{\"data\":{\"userId\":2453,\"oldErpId\":66995,\"userName\":\"质控部张金桐\",\"userGender\":\"男\",\"userIdNumber\":\"130281199806212934\",\"userTel\":\"15097532730\",\"virtualTel\":\"03156273213(18633159152)\",\"userDept\":43,\"userRoleId\":4,\"joinTime\":1546876800000,\"userState\":\"正常\",\"userDeleted\":0,\"userTwins\":0,\"userDeleteDate\":0,\"joinPosTime\":1564416000,\"posLevel\":\"A6\",\"mobileWorkPhone\":\"15097532730\",\"mobileVirtual\":\"17897515081\"},\"utype\":\"user\"}";
        jsonStr="{\"callId\":\"22019103122355503405746271\",\"data\":\"{\\\"callId\\\":\\\"22019103122355503405746271\\\",\\\"bindingId\\\":\\\"02201910312235476924362412\\\",\\\"callNo\\\":\\\"15732070700\\\",\\\"peerNo\\\":\\\"18332658537\\\",\\\"telX\\\":\\\"17897509192\\\",\\\"callTime\\\":\\\"2019/10/31 22:35:55\\\",\\\"startTime\\\":\\\"2019/10/31 22:36:01\\\",\\\"finishTime\\\":\\\"2019/10/31 22:36:01\\\",\\\"callDuration\\\":0,\\\"finishStatus\\\":\\\"3\\\",\\\"clientData\\\":\\\"FY-19-46691\\\",\\\"callType\\\":1,\\\"operatorid\\\":2793}\",\"numberType\":1,\"type\":3}";
        channel.basicPublish(EXCHANGE_NAME, TOPIC, null, jsonStr.getBytes());

        channel.close();
        connection.close();


    }
}